// ZipRegistry.h

#ifndef __ZIP_REGISTRY_H
#define __ZIP_REGISTRY_H


#include "Common/Archive/ExtractMode.h"

#include "Common/MyFixes.h"

#include <vector>

namespace Common
{

namespace Archive
{

namespace Extract
{
  struct CInfo
  {
	PathMode PathMode;
	OverwriteMode OverwriteMode;
	bool ShowPassword;
	CStringVector Paths;

	void Save() const;
	void Load();
  };
}

namespace Compression
{
  struct CFormatOptions
  {
	UINT32		Level;
	UINT32		Dictionary;
	UINT32		Order;
	UINT32		BlockLogSize;
	UINT32		NumThreads;
	
	CString		FormatID;
	CString		Method;
	CString		Options;
	CString		EncryptionMethod;

	void ResetForLevelChange()
	{
	  BlockLogSize = NumThreads = Level = Dictionary = Order = UINT32(-1);
	  Method.Empty();
	  // Options.Empty();
	  // EncryptionMethod.Empty();
	}
	CFormatOptions() { ResetForLevelChange(); }
	CFormatOptions(const CFormatOptions &obj) :
		Level(obj.Level),
		Dictionary(obj.Dictionary),
		Order(obj.Order),
		BlockLogSize(obj.BlockLogSize),
		NumThreads(obj.NumThreads),		
		FormatID(obj.FormatID),
		Method(obj.Method),
		Options(obj.Options),
		EncryptionMethod(obj.EncryptionMethod)
	{
	}
  };

  struct CInfo
  {
	UINT32 Level;
	bool ShowPassword;
	bool EncryptHeaders;
	CString ArcType;
	CStringVector ArcPaths;
	typedef std::vector<CFormatOptions> ArrayFormatOptions;
	ArrayFormatOptions Formats;

	void Save() const;
	void Load();
  };
}



struct CContextMenuInfo
{
  BOOL Cascaded;
  UINT32 Flags;

  void Save() const;
  void Load();
};

namespace WorkDir
{
  
	enum  class Mode
	{
		kSystem,
		kCurrent,
		kSpecified
	};
  
  struct CInfo
  {
	Mode Mode;
	CString Path;
	bool ForRemovableOnly;

	void SetForRemovableOnlyDefault() { ForRemovableOnly = true; }
	void SetDefault()
	{
	  Mode = Mode::kSystem;
	  Path.Empty();
	  SetForRemovableOnlyDefault();
	}

	void Save() const;
	void Load();
  };
  
  //This function is used only one place UpdateGUI.cpp
  CString GetWorkDir(const WorkDir::CInfo &workDirInfo, const CString &path);
}

} //Archive

} //Common
#endif
